<template>
	<view class="bg-white w100"
		style="box-shadow: 0px 0px 8px 0px rgba(105, 70, 255, 0.3);border-radius: 10px 10px 0px 0px;">
		<!-- 司机已结单  ||   司机已到达，订单进行中-->
		<view class="flex pd-36">
			<view>
				<view class="size-36 bold">{{status==1?'司机已接单':'司机已到达，订单进行中'}}</view>
				<view class="mt-10">预计18点07分到达</view>
			</view>
		</view>

		<view class="flex plr-36 pt-50">
			<view class="flex1 flex-middle">
				<view class="img">
					<image src="../../static/siji.png" mode=""></image>
				</view>
				<view class="ml-40">
					<view class="mb-10">
						155****5555
					</view>
					<view class="flex_l">
						<u-rate :count="5" v-model="score" active-color="#FDD800" inactive-color="#999"
							:disabled="true"></u-rate>
						<view class="size-26 ml-20" style="color:#FDD800;">5分</view>
					</view>
				</view>
			</view>
			<view class="img1">
				<image @click="call('15555555555')" src="../../static/tel.png" mode=""></image>
			</view>
		</view>
		<view class="pd-36">
			<u-button type="primary" @click="call('110')">一键报警</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['info', 'huoyun'], //1=已接单,2=进行中,3=待支付,4=司机已到达,5=预约单待司机出发,99=已完成
		data() {
			return {
				status: 1,
				score: 5
			}
		},
		computed: {
			score() {
				return this.info.score || 0
			}
		},
		onShow() {

		},
		methods: {
			change(e) {
				console.log(e);
			},
			// 1、5 司机已接单  4 司机已到达
			cancle(status) {
				console.log(this.info)
				if (this.huoyun) {
					uni.navigateTo({
						url: '/pages/huoyun/cancle-order?id=' + this.info.id
					})
				} else {
					if (status == 1 || status == 5) {
						uni.navigateTo({
							url: '/pages/home/dj-cancel?id=' + this.info.id + '&type=1'
						})
					} else if (status == 4) {
						uni.navigateTo({
							url: '/pages/home/cancel?tel=' + this.info.driver.mobile
						})
					}
				}
			},
			call(tel) {
				uni.makePhoneCall({
					phoneNumber: tel //仅为示例
				});
			},
			tousu() {
				let sf_type = this.huoyun ? 2 : ''
				uni.navigateTo({
					url: '../../pages/my/complaints/index?id=' + this.info.id + '&sf_type=' + sf_type
				})
			},
			pay() {
				this.$emit('pay')
			},
			// 评分
			comment(value) {
				this.$http(this.huoyun ? '/addons/ddrive/hyorder/comment' : '/addons/ddrive/order/comment', {
					order_id: this.info.id,
					score: value
				}, "POST").then(data => {})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.img {
		image {
			width: 128rpx;
			height: 128rpx;
		}
	}

	.img1 {
		image {
			width: 86rpx;
			height: 86rpx;
		}
	}
</style>
